package cn.tedu.util;

import com.sun.xml.internal.ws.policy.privateutil.PolicyUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;

public class Test3_1 {
    public static void main(String[] args) {
    ArrayList<Integer> list =new ArrayList<>();
    Collections.addAll(list,1,2,3,3,4,5);
    ArrayList<Integer> list2=new ArrayList<>();
        for (Integer date:list2) {
            if (!list2.contains(date)){
                list2.add(date);
            }
        }
        System.out.println(list2);

        ArrayList<Integer> list1=new ArrayList<>();
        Collections.addAll(list,1,2,3,45,6);
        HashSet<Integer> set=new HashSet<>();
        for (Integer date:list1) {
            set.add(date);
        }
        System.out.println(set);
    }
}
